package com.animal.controller;


import com.animal.entity.dto.OrderDto;

import com.animal.service.OrderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;


import java.util.List;

@Controller
@RequestMapping("/order")
public class OrderController {
    @Autowired
    private OrderService orderService;

    /**
     * 排行榜
     *
     * @return
     */
    @PostMapping("/ranking ")
    public String goodsRanking( Model model) {
        List<OrderDto> list = orderService.orderShow();
        model.addAttribute("goodslist", list);
        return "goods";
    }
}
